/******************** 
	作用:登陆页面
	作者:蔡俊雄
	版本:V1.0
	时间:2015-07-30
********************/

function formcheck() {
	if ($('#remember:checked').length == 1) {
		$.cookie('remember-username', $(':text[name="username"]').val());
	} else {
		$.removeCookie('remember-username');
	}
	return true;
}

window.onerror=function() {
	return true;
}
$(function($) {
	try {
		var h = document.documentElement.clientHeight;
		$(".login").css('min-height', h);
	} catch (e) {
	}

	//刷新验证码
	$("#refresh,#verificationCode").on("click", function(e) {
		var url = Common.addUrlParameters($("#verificationCode").attr("src"), {
			"nocache": new Date().getTime()
		});
		$("#verificationCode").attr("src", url);
	});

	$(document).on('click', '.social a[data-target]', function(e) {
		e.preventDefault();
		var target = $(this).data('target');
		$('.widget-box.visible').removeClass('visible'); //hide others
		$(target).addClass('visible'); //show target
	});
	if(window.top!=window){
		window.top.location.href = window.location.href;
	}
});